package createThread.gift;

/**
 * @author wang'ji'cheng
 * @date 2025/7/25
 */
public class SendGift extends Thread {
    static int count = 100;
    static Object objB = new Object();

    @Override
    public void run() {

        while (true) {
            synchronized (SendGift.class) {
                if (count <10) {
                    break;
                } else {
                    count--;
                    System.out.println(Thread.currentThread().getName() + "在赠送礼物，还剩下" + count + "个礼物!!!");
                }
            }
        }

    }
}
